﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Program05
{
   public class Course1
    {
        public string Name { get; set; }

        private int _period;
        public int Period
        {
            get => _period;
            set => _period = value < 0 ? 0 : value;
        }

        private int _credit;
        public int Credit
        {
            get => _credit;
            set => _credit = value < 0 ? 0 : value;
        }

        private int _score;
        public int Score
        {
            get => _score;
            set => _score = value < 0 || value > 100 ? 0 : value;
        }

        public override string ToString() => $"课程名：{Name},学时：{Period},学分：{Credit},成绩：{Score}";
    }
}
